;;;;;; test-expander.scm - Syntax Expander test module.    -*- Mode: Scheme -*-
;;;;;; Author: Erik Silkensen <silkense@colorado.edu>
;;;;;; Version: 28 Jun 2009

(require "../parser.scm")
(require "../syntax-expander.scm")

(printf ";; Syntax Expander test REPL~n")
(printf ";; Use Ctrl-D (i.e., EOF) to exit.~n")
(port-count-lines! (current-input-port))
(let ((env (make-global-environment)) (prompt "> "))
  (display prompt)
  (flush-output)
  (let repl ((datum (read-datum)))
    (if datum
        (let ((dat (expand-datum datum env)))
          (when (datum? dat)
                (pretty-print (datum->syntax dat)))
          (display prompt)
          (flush-output)
          (repl (read-datum)))
        (newline))))
